<div class="columns redeed_present" bid="{$bid}">
	<h2 class="col-h2">{lang checkGift}</h2>
	<ul class="col-ul clearfix j-zhong">
		<!--{loop $data $gift}-->
			<li>
			<a class="a-img1">
			<img name="img_gift" id="gift{$gift['id']}" alt="$gift['title']"  src="$gift['image']" onclick="open_img(this)" />
			</a>
				{if $gift['credit']>$user['credit1'] }
					<p title="{$gift['title']}"><a href="javascript:alert('{lang checkCreditTip2}');">{$gift['shorttitle']}</a><span class="red">$gift['credit']{lang needGolds}</span></p>
					<a href="javascript:alert('{lang checkCreditTip2}');" class="btn_sys disabled">我要兑换</a>
				{else}					
					<p title="{$gift['title']}"><a id="title{$gift['id']}" href="javascript:apply($gift['id']);">{$gift['shorttitle']}</a><span class="red">$gift['credit']{lang needGolds}</span></p>
					<a href="javascript:apply($gift['id']);" class="btn_sys">我要兑换</a>
				{/if}
				
			</li>
			<div  id="credit{$gift['id']}" style="display:none">$gift['credit']</div>
			<div  id="description{$gift['id']}" style="display:none">$gift['description']</div>
		<!--{/loop}-->
	</ul>
	
	
	<div id="gift_dialog" style="display:none">
		<form id="giftform"  action="{url gift-apply}" method="post">
		<input id="gid"  type="hidden" name="gid" value="" />
		<div class="lp_info j-zhong a-l">
			<div class="l">			
				<b class="a-img1"><img id="giftdiv" src="style/default/jfhl/lp_01.jpg"/></b>
			</div>
			<h3 class="f16 cblue" id="titlediv"></h3>
			<ul class="gray">
				<li	id="creditdiv"></li>
				<li	id="descriptiondiv"></li>
			</ul>
		</div> 
		<p class="red ico-warna m-t20">{lang checkCreditTip5}</p>
		<ul class="ul_l_s real_info a-l">
		<li><span>{lang realname}：</span><input id="truename" name="truename" type="text" class="inp_txt" value="{$user['truename']}"/><label class="red">*</label><label class="tip red" id="v_truename">{lang importantTip}</label></li>
		<li><span>{lang tel}：</span><input id="telephone" name="telephone" type="text" class="inp_txt" value="{$user['telephone']}"/><label class="red">*</label><label class="tip red" id="v_telephone">{lang importantTip}</label></li>
		<li><span>E-mail：</span><input id="email" name="email" type="text" class="inp_txt" value="{$user['email']}"/><label class="red">*</label><label class="tip red" id="v_email"></label></li>
		<li><span>{lang address}：</span><input id="location" name="location" type="text" class="inp_txt" size="50" value="{$user['location']}"/><label class="red">*</label><label class="tip red" id="v_location">{lang importantTip}</label></li>
		<li><span>{lang ZipCode}：</span><input id="postcode" name="postcode" type="text" class="inp_txt" value="{$user['postcode']}"/><label class="red">*</label><label class="tip red" id="v_postcode"></label></li>
		<li><span>{lang Notes}：</span><textarea name="extra" rows="3" cols="45"></textarea></li>
		<li><span>{lang qq}：</span><input name="qq" type="text"class="inp_txt" value="{$user['qq']}" /></li>
		<li><input name="submit" type="submit" value="{lang sure}" class="btn_inp blue"/><input name="cancel" type="button" value="{lang cancel}" class="btn_sys" onclick="javascript:mycancel();" /></li>
		</ul>
		</form>
	</div>
 
<script type="text/javascript" src="js/validator.js"></script>
<script type="text/javascript">
var Validator_giftform;

function apply(gid){
	$("#gid").attr('value',gid);
	$("#giftdiv").attr("src",$("#gift"+gid).attr("src"));
	$("#titlediv").html(' 您兑换的奖品：'+$("#title"+gid).html() );
	$("#creditdiv").html( '<span >所需金币：</span><b class="red">'+$("#credit"+gid).html()+'</b>' );
	$("#descriptiondiv").html( '<span >礼品描述：</span>'+$("#description"+gid).html() );
	
	$.dialog.open('gift', '奖品兑换申请', 'selector:#gift_dialog');
	$("#gift_dialog").empty();
	
	if(!Validator_giftform){
		Validator_giftform=new Validator("giftform",false,null);
		Validator_giftform.bind("truename",[["empty","真实姓名不能为空"]]);
		Validator_giftform.bind("telephone",[["empty","电话不能为空"],["phone","电话格式不正确"]]);
		Validator_giftform.bind("email",[["empty","email不能为空"],["email","email格式不正确"]]);
		Validator_giftform.bind("location",[["empty","邮寄地址不能为空"]]);
		Validator_giftform.bind("postcode",[["empty","邮编不能为空"],["zip","邮编格式不正确"]]);
	}
}

function mycancel(){
	$.dialog.close('gift');
}

function open_img(E){
	var path=E.src;
	$.dialog.open('gift_img', E.alt, 'img:'+path.replace("_s.", '.'),'c');
}
</script>

</div>
 